package com.diandian.backend.entrance.client;

import com.diandian.backend.entrance.client.dto.CertificateCancelParamDTO;
import com.diandian.backend.entrance.client.dto.CertificatePrepareParamDTO;
import com.diandian.backend.entrance.client.dto.CertificateVerifyParamDTO;
import com.diandian.base.boot.starter.response.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("kuaishou-life-exchange")
//@FeignClient(value = "business-kuaishou-life-exchange", url = "http://localhost:10018", path = "")
public interface DianDianKuaiShouLifeExchangeClient {

    @GetMapping( "/token/get")
    BaseResult getToken(@RequestHeader(name = "appKey", required = false) String appKey,
                               @RequestHeader(name = "appSecret", required = false) String appSecret,
                               @RequestHeader(name = "merchantId", required = false) String merchantId);

    @GetMapping( "/token/generate")
    BaseResult generateToken(@RequestHeader(name = "appKey") String appKey,
                                    @RequestHeader(name = "appSecret") String appSecret,
                                    @RequestParam(name = "code") String code,
                                    @RequestParam(name = "state") String state);

    @PostMapping( "/certificate/prepare")
    BaseResult prepare(@RequestHeader(name = "appKey") String appKey,
                              @RequestHeader(name = "appSecret") String appSecret,
                              @RequestHeader(value = "merchantId") String merchantId,
                              @RequestBody CertificatePrepareParamDTO param);

    @PostMapping( "/certificate/prepareWithOrderDetail")
    BaseResult prepareWithOrderDetail(@RequestHeader(name = "appKey") String appKey,
                                             @RequestHeader(name = "appSecret") String appSecret,
                                             @RequestHeader(value = "merchantId") String merchantId,
                                             @RequestBody CertificatePrepareParamDTO param);

    @PostMapping( "/certificate/verify/offlineStoreCode")
    BaseResult verifyWithOfflineStoreCode(@RequestHeader(name = "appKey") String appKey,
                                                 @RequestHeader(name = "appSecret") String appSecret,
                                                 @RequestHeader(value = "merchantId") String merchantId,
                                                 @RequestHeader(value = "belong") String belong,
                                                 @RequestBody CertificateVerifyParamDTO param);

    @PostMapping( "/certificate/cancel")
    BaseResult cancel(@RequestHeader(name = "appKey") String appKey,
                             @RequestHeader(name = "appSecret") String appSecret,
                             @RequestHeader(value = "merchantId") String merchantId,
                             @RequestBody CertificateCancelParamDTO param);
}
